import Loadable from 'react-loadable'
// import Page404 from '../pages/page404';
import Loading from '../components/loading'

const loadable = (component) =>
    Loadable({
        loader: component,
        loading: Loading,
    })

const routes: routeItem[] = [
    {
        path: '/',
        name: '首页',
        exact: true,
        visitor: true,
        authorized: 'forcibly',
        component: loadable(() => import('../pages/index/index')),
    },
    {
        path: '/qa',
        name: '快问',
        exact: true,
        visitor: true,
        authorized: 'forcibly',
        component: loadable(() => import('../pages/qa')),
    },
    {
        path: '/ask',
        name: '提问',
        exact: true,
        visitor: true,
        authorized: 'forcibly',
        component: loadable(() => import('../pages/Ask')),
    },
    {
        path: '/qa-detail/:id',
        name: '快问',
        exact: true,
        visitor: true,
        authorized: 'forcibly',
        component: loadable(() => import('../pages/detail')),
    },
    // {
    //     path: "*",
    //     name: "404",
    //     visitor: true,
    //     component: Page404,
    // },
]

export default routes
